﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace Catering_Rules
{
    public class RecipesRule
    {
        private readonly Catering_Operation.RecipesRule dal = new Catering_Operation.RecipesRule();

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(Catering_Model.RecipesRule model)
        {
            dal.Add(model);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Catering_Model.RecipesRule model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int id)
        {
            return dal.Delete(id);
        }

        /// <summary>
        /// 根据食谱删除数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool DeleteByRecipesID(int id)
        {
            return dal.DeleteByRecipesID(id);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Catering_Model.RecipesRule GetModel(int id)
        {
            return dal.GetModel(id);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Catering_Model.RecipesRule GetModel(int RecipesID, int DTID)
        {
            return dal.GetModel(RecipesID, DTID);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }
    }

    public class RecipesRuleManage
    {
        private readonly Catering_Operation.RecipesRuleManage dal = new Catering_Operation.RecipesRuleManage();
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(Catering_Model.RecipesRuleManage model)
        {
            dal.Add(model);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Catering_Model.RecipesRuleManage model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int DTID)
        {
            return dal.Delete(DTID);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Catering_Model.RecipesRuleManage GetModel(int DTID)
        {
            return dal.GetModel(DTID);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }

        public Dictionary<int,string> GetRuleTypelist()
        {
            Dictionary<int, string> dic = new Dictionary<int, string>();
            dic.Add(1, "每天可重复");
            dic.Add(2, "每周可重复");
            return dic;
        }
    }
}
